<!--
Copyright 2003 Cordys R&D B.V. 

This file is part of the Cordys SAP Connector. 

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
	Project		: Cordys BAC
	File Name	: showfromtopage.htm
	Description : This page is used to get from and to parameters to limit the search.
-->
<html xmlns:eibus onselect="selectApplication()" onbeforeapplicationclose="checkReturnData()">
<head>
	<title>Metadata Filter</title>
	<style>
		label		{	font-size:11; font-family:verdana; font-weight:normal;	}
		input		{	font-size:11; font-family:verdana;	}
		button		{	font-size:11; font-family:verdana;	}
		.heading	{	font-size:11; font-family:verdana;	}
	</style>
	<link rel="stylesheet" type="text/css" href="/cordys/wcp/style/behaviors.css">
	<script language="JScript">
	//Return data to carry the filter
	var returnData = null;
	var isFilter = false ;
	//Set the returnData
	function selectApplication()
	{
		returnData = event.data;
		if (returnData.from) from.value = returnData.from;
		if (returnData.to) to.value = returnData.to;
		from.select();
		switch (returnData.base )
		{
			case "RFCs" :
				from.title = "From the RFC which starts with this substring";
				to.title = "Upto the RFC which starts with this substring";
				break ;
			case "IDOCMesTypes" :
				from.title = "From the message type which starts with this substring";
				to.title = "Upto the message type which starts with this substring";
				break ;
		}
	}
	//Sets the filter type
	function setFilter()
	{
		returnData.from = from.value;
		returnData.to = to.value;
		isFilter = true ;
		window.close();
	}

	//Checks the key pressed on the document and cancels the window if ESC is pressed and request sent if ENTER is pressed
	function checkKey()
	{
		if (event.keyCode == 27)
		{
			isFilter = false ;
			window.close();
		}
		else if (event.keyCode == 13) setFilter();
	}
	function checkReturnData()
	{
		if (isFilter == false )
		{
			returnData.from = null ;
			returnData.to = null ;
		}
	}
	</script>

</head>

<body onkeypress="checkKey()" scroll="no">
<table border=0 id="filterWindow" cellspacing=0 cellpadding=0 style="margin:10px;position:absolute;border:2px;width:270px;height:80px">
	<tbody>
		<tr><td style="height:10px" colspan=3></td></tr>
		<tr>
			<td style="width:5%"></td>
			<td>
				<div style="width:250px;height:70px">
					<table border=0>
						<tbody>
							<tr>
								<td><span class="heading">Enter the filter criteria :</span></td>
								<td><label id="fieldName"></label></td>
							</tr>
							<tr><td height="5px"></td></tr>
							<tr>
								<td><label style="width:50px">From</label><input type="text" style="width:190px" id="from"></td>
							</tr>
							<tr><td height="1px"></td></tr>
							<tr>
								<td><label style="width:50px">To</label><input type="text" style="width:190px" id="to"></td>
							</tr>
							<tr><td height="1px"></td></tr>
						</tbody>
					</table>
				</div>
			</td>
			<td style="width:5%"></td>
		</tr>
		<tr><td style="height:8px" colspan=3></td></tr>
		<tr>
			<td colspan=3>
				<div style="width:100%;height:25px" align="center">
					<span style="width:30%"><button class=medium type=button style="width:65px" onclick="setFilter()">OK</button></span>
					<span style="width:30%"><button class=medium style="width:65px" onclick="window.close()">Cancel</button></span>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</body>
</html>